<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户列表</title>
<link href="styles/core.css" rel="stylesheet" type="text/css">
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript">
var basePath = "<%=basePath%>";
</script>
<script type="text/javascript" src="scripts/system/user.js"></script>
</head>
<body>
<form  name="userForm" method="post" onsubmit="return false;">
<s:hidden name="pagerEntity.pageInfo.pageNow" id="pageNow"></s:hidden>
<h2 style="text-align: left">用户列表</h2>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="right" width="15%">
			用户名：
		</td>
		<td align="left" width="30%">
			<s:textfield name="user4Search.userName" cssClass="input"></s:textfield>
		</td>
		<td align="right" width="15%">
			角色：
		</td>
		<td align="left">
			<s:select name="user4Search.roleId" id="roleId" list="#request.roleList" listKey="columeId" listValue="name" headerKey="" headerValue="" cssStyle="width: 150px;" ></s:select>
		</td>
		<td align="right" width="15%" rowspan="2">
			<input type="image" src="<%=basePath%>images/search.jpg" onclick="search();"></input>
			<!-- <input type="image" src="<%=basePath%>images/excel.jpg" onclick="exportExcel();"></input> -->
			<input type="image" src="<%=basePath%>images/add.jpg" onclick="add();"></input>
		</td>
	</tr>
	<tr>
		<td align="right">
			工作人员编号：
			<input type="button" value="..." class="btn_mouseout" onclick="selectWorker();return false;"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
		</td>
		<td align="left" colspan="3">
			<s:textfield name="user4Search.workerCode" id="workerCode" cssClass="input" onblur="return getWorkerInfo();"></s:textfield>
			<s:label id="workerName" name="user4Search.workerName"></s:label>
			<s:hidden id="hdnWorkerName" name="user4Search.workerName"></s:hidden>
		</td>
	</tr>
</table>
<hr width="100%" align="left" size="1" color="#E1EEF8">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
	class="tabHeader" id="dataInfo">
	<thead>
		<tr align="center" class="tdBg">
			<td style="text-align: center" nowrap="nowrap" width="10%">用户编号</td>
			<td style="text-align: center" nowrap="nowrap" width="10%">用户名</td>
			<td style="text-align: center" nowrap="nowrap" width="10%">角色</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">工作人员</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">最后登录IP</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">最后登录时间</td>
			<td style="text-align: center" nowrap="nowrap" width="10%">操作</td>
		</tr>
	</thead>
	<tbody>
		<s:if test="#request.pagerEntity.resultList.size==0">
	   		<tr>
	   			<td colspan="9" align="center">
	   				对不起！没有搜索到结果......
	   			</td>
	   		</tr>
	   	</s:if>
	   	<s:else>
			<s:set id="total" value="0"></s:set>
		    <s:set id="totalSum" value="0"></s:set>
			<s:iterator value="pagerEntity.resultList" id="user">
				<tr>
					<td>
						<s:property value="#user.userId"/>
					</td>
					<td >
						<s:property value="#user.userName"/>
					</td>
					<td>
						<s:property value="#user.roleName"/>
					</td>
					<td align="left">
						<s:property value="#user.workerCode"/>&nbsp;<s:property value="#user.workerName"/>
					</td>
					<td align="center">
						<s:property value="#user.lastLoginIp"/>
					</td>
					<td align="center">
						<s:if test="#user.lastLoginTime != null">
							<s:text name="format.datetime">
								<s:param value="%{#user.lastLoginTime}"></s:param>
							</s:text>
						</s:if>
						<s:else>
							未登录过
						</s:else>
					</td>
					<td nowrap="nowrap" align="center">
						<s:url id="modifyUser" value="system/user-modify.action">
			        		 <s:param name="user.userId" value="#user.userId"></s:param>
			    		</s:url>
			    		<s:url id="deleteUser" value="system/user-delete.action">
			        		 <s:param name="user.userId" value="#user.userId"></s:param>
			    		</s:url>
		    			<s:if test='!#user.isSuperAdmin'>
		    				<s:if test='#user.userId != #session._login_user_info.userId'>
					    		<s:a href="%{deleteUser}" onclick="return delpay()">
									<img src="images/delete.jpg" style="vertical-align: middle" border="0">删除&nbsp;&nbsp;
								</s:a>
							</s:if>
							<s:a href="%{modifyUser}">
								<img src="images/update.jpg" style="vertical-align: middle" border="0">修改
							</s:a>
						</s:if>
					</td>
				</tr>
			</s:iterator>
			<tr class="tdBg">
				<td colspan="7" align="right">
					<s:include value="/pages/pagefooter.jsp"></s:include>
				</td>
			</tr>
		</s:else>
	</tbody>
</table>
</form>
</body>
</html>